Skip to content

Glasgow | 26-ITP-May | Sandani Kannangara | Sprint 3 | Practice Tdd#1382

Open
SandzSoft wants to merge 4 commits into
CodeYourFuture:mainfrom
SandzSoft:coursework/sprint-3-practice-tdd
Open

Glasgow | 26-ITP-May | Sandani Kannangara | Sprint 3 | Practice Tdd#1382
SandzSoft wants to merge 4 commits into
CodeYourFuture:mainfrom
SandzSoft:coursework/sprint-3-practice-tdd

Conversation

@SandzSoft

Copy link
Copy Markdown

Self checklist

  • I have titled my PR with Region | Cohort | FirstName LastName | Sprint | Assignment Title
  • My changes meet the requirements of the task
  • I have tested my changes
  • My changes follow the style guide

Changelist

Completed Sprint 3 practice TDD exercises.
Implemented and tested the following functions:

  • countChar: counts occurrences of a character in a string
  • repeatStr: repeats a string a given number of times
  • getOrdinalNumber: converts numbers to ordinal format (st, nd, rd, th)

Added both implementation logic and Jest test coverage for all functions, including edge cases and invalid inputs.

@SandzSoft SandzSoft added 📅 Sprint 3 Assigned during Sprint 3 of this module Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. Module-Structuring-And-Testing-Data The name of the module. labels Jun 22, 2026

@cjyuan cjyuan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good. Tests are comprehensive. Well done.

I only have one request.

expect(getOrdinalNumber(3)).toEqual("3rd");
expect(getOrdinalNumber(33)).toEqual("33rd");
});
test("appends th for all other numbers", () => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When a test fails with the message "... all other numbers", it may be unclear what "other numbers" actually refers to.
Can you revise the test description to make it more informative?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the feedback. I've updated the test description to make the category of numbers more specific and informative.

@cjyuan cjyuan added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Jun 27, 2026
@SandzSoft SandzSoft added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. and removed Reviewed Volunteer to add when completing a review with trainee action still to take. labels Jun 27, 2026
@cjyuan

cjyuan commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

Changes look good.

@cjyuan cjyuan added Complete Volunteer to add when work is complete and all review comments have been addressed. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Jun 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Complete Volunteer to add when work is complete and all review comments have been addressed. Module-Structuring-And-Testing-Data The name of the module. 📅 Sprint 3 Assigned during Sprint 3 of this module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants